<?php
	class Code_export_form_tmp_model extends CI_Model {
	    
    var $id;	    
    var $export_form_id;    
    var $xxxl_code;
    var $xxl_code;
    var $xs_code;
    var $xl_code;
    var $s_code;
    var $m_code;
    var $l_code;    
	var $active;

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }

    // load all Storage
    function loadAll($cond = false)
    {
        if($cond)
        {
            $query = $this->db->get_where('code_export_form_tmp',array('export_form_id' => $cond));
        }
        else
        {
            $query = $this->db->get('code_export_form_tmp');
        }
        return $query->result();
    }    

    function getEntry($id)
    {
        $query = $this->db->get_where('code_export_form_tmp', array('id' => $id));
        return $query->row();
    }    

    function insert($data)
    {
        $this->db->insert('code_export_form_tmp', $data);
        return $this->db->insert_id();
    }

    function remove($cond)
    {
        foreach ($cond as $key => $value) 
        {
            $this->db->where("$key", $value);            
        }
        $this->db->delete('code_export_form_tmp');
    }

    function removeWithId($id)
    {
        $this->db->where('id',$id);
        $this->db->delete('code_export_form_tmp');   
    }
}